Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about DTR behavior on linux #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jannic
Copy link
Contributor

@jannic jannic commented Jan 14, 2025

TL;DR: Linux always sets DTR on open, and you can't prevent that without kernel modifications.

See #37 for more information, most importantly the linked stack overflow question. When working on #40 about 3 years ago, I verified that this was actually true. A quick search through the kernel git history didn't show any recent change.

The only thing I'm not sure about is if this is true for all serial ports on linux, or if it is driver dependent. So maybe the comment should be less strong? (Eg. "On Linux, DTR may automatically be set on open...")?

@sirhcel
Copy link
Contributor

sirhcel commented Jan 14, 2025

Thank you for extending the documentiation @jannic!

The only thing I'm not sure about is if this is true for all serial ports on linux, or if it is driver dependent. So maybe the comment should be less strong? (Eg. "On Linux, DTR may automatically be set on open...")?

After a quick reading it looks to me like serial_core.c is initiating this and all driver supporting DTR will set it. Do you have a good reference from your earlier research on this topic? If not, the current note from this PR looks like a pretty good approximation on setting DTR on Linux. I'm inclined to keep a low profile, let someone who really knows better prove us wrong and land this PR as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants